<div id="wrapper">
    <h1>Inscription</h1>

    <div>
        <?php
        echo $this->form;
        ?>
    </div>
</div>

<script type="text/javascript" src="<?php echo $this->baseUrl ?>/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/js/zendtremplin_functions.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        var submit = $("#submit");
        submit.attr('disabled', 'true');
        var login = $("#login");
        login.keyup(function() {
            $.ajax({
                type: "POST",
                url: '/inscription/index/checklogin',
                data: 'login='+login.val(),
                success: function(data) {
                    if(data!=null) {
                        ZendTremplin_addErrorAfter('login','error_login',data);
                        if(data == '') {
                            submit.removeAttr('disabled');
                        }
                        else {
                            submit.attr('disabled', 'true');
                        }
                    }
                }
            });
        });
    });
</script>